{% extends 'base.html' %}

{% block title %}{{ site.config }} - {% endblock %}

{% block content %}
Message: {{ message }}
    <form name="dataform" action="{{ request.path }}" method="POST">
<fieldset>
<select name="modelname">
      <option value="">--</option>
      {% for curname in modelnames %}
      <option value="{{ curname }}" {% if curname == modelname %}selected{% endif %}>{{ curname }}</option>
      {% endfor %}
    </select>
<select name="selectedkey">
      <option value="">--</option>
      {% for modelkey in modelkeys %}
      <option value="{{ modelkey }}" {% if modelkey == key %}selected{% endif %}>{{ modelkey }}</option>
      {% endfor %}
    </select>
    <input name="action" type="submit" value="Query" />
</fieldset><fieldset>
    Key: <input type="text" name="key" value="{{ key }}" size="60"/>
    <br/><textarea name="value" style="width:100%;height:200px;">{{ value }}</textarea>
    <br/><input name="action" onclick="return confirmRemove();" type="submit" value="Remove" />
    <input name="action" type="submit" value="Save" />
</fieldset>
    </form>
{% endblock %}

{% block jscodes %}
<script>
function confirmRemove() {
  var key = document.dataform.selectedkey.value;
  return window.confirm("Do you really want to delete \"" + key + "\"?");
}
</script>
{% endblock %}

